package com.bwf.service;

import java.io.File;
import java.io.FilenameFilter;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/5/18 13:47
 * @Copyright 博为峰
 */
public class FilenameFilterImpl implements FilenameFilter {
    private String cardNo;

    public FilenameFilterImpl(String cardNo) {
        this.cardNo = cardNo;
    }

    @Override
    public boolean accept(File dir, String name) {
        return name.substring(0,name.indexOf(".")).endsWith(this.cardNo);
    }
}
